<!--
  Test Demo Component

  A demo for testing visualization
  
  Category: Basic

  Component Documentation:
  ========================

  Title: Test Demo
  Description: A demo for testing visualization
  Features:
    - Shows how to create a basic Cesium viewer
    - Demonstrates how to add entities to the viewer
    - Provides a structure for organizing demo code
-->

<template>
  <BaseCesiumViewer 
    ref="cesiumViewer" 
     
    @viewer-ready="onViewerReady"
  />
</template>

<script>
import { ref } from 'vue';
import BaseCesiumViewer from '../core/BaseCesiumViewer.vue';

export default {
  name: 'TestDemo',
  components: {
    BaseCesiumViewer
  },
  setup() {
    const cesiumViewer = ref(null);

    // This function is called when the Cesium viewer is ready
    const onViewerReady = (payload) => {
      // Check if payload and viewer are valid
      if (!payload || !payload.viewer) {
        console.error('Viewer is not ready or payload is invalid');
        return;
      }
      
      // eslint-disable-next-line no-unused-vars
      const { viewer, Cesium } = payload;
      
      // TODO: Implement your demo here
      console.log('TestDemo is ready!');
    };

    return {
      cesiumViewer,
      onViewerReady
    };
  }
};
</script>

<style scoped>
/* 
  Add any custom styles for your demo here
*/
</style>
